package bolangit.test.utils;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;

/**
 * @author lxr
 * @date 2019/2/27
 * @email 200890949@qq.com
 * @decreption 相应消息
 */
public class AjaxResponse<E> implements Serializable {
	
	private static final long serialVersionUID = -228336292076840249L;
	
	@ApiModelProperty(value="操作结果标识，成功返回200")
	private int code = ErrorCode.SUCCESS;
	
	@ApiModelProperty(value="操作结果描述")
	private String message = "操作成功！";
	
	@ApiModelProperty(value="业务数据")
	private E result;
	
	@ApiModelProperty(value="请求时间")
	private Date t=new Date();
	
	public AjaxResponse(Date t) {
		super();
		this.t=t;
	}
	public AjaxResponse() {
		super();
	}
	public AjaxResponse(int code, String message) {
		super();
		this.code = code;
		this.message = message;
	}
	public AjaxResponse(int code, String message, Date t) {
		super();
		this.code = code;
		this.message = message;
		this.t=t;
	}
	public AjaxResponse(E result) {
		super();
		this.result = result;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public E getResult() {
		return result;
	}
	public void setResult(E result) {
		this.result = result;
	}
	public Date getT() {
		return t;
	}
	public void setT(Date t) {
		this.t = t;
	}
}

